package com.cxria.pattern.memento.func3

def originator = new Originator2()

originator.state = 'a'

println originator.state

def caretaker = new Caretaker()

caretaker.memento = originator.createMemento()

originator.state = 'b'

println originator.state

originator.restoreMemento(caretaker.memento)

println originator.state